This repository was archived by the owner on May 15, 2026. It is now read-only.
fix(mcp): pretty-print tool responses in UI - #11115
Open
hannesrudolph wants to merge 3 commits into
Open
Conversation
Re-review complete. No new issues flagged.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
ghost
reviewed
Jan 30, 2026
Comment on lines
+89
to
+92
| if (parsed === undefined && (trimmed.includes('\\"') || trimmed.includes("\\\\"))) { | ||
| const unescaped = trimmed.replaceAll("\\\\", "\\").replaceAll('\\"', '"') | ||
| parsed = tryParseJsonValue(unescaped) | ||
| } |
There was a problem hiding this comment.
The unescape fallback (replaceAll(\\\\, \\).replaceAll('\\"', '"')) is fairly aggressive and can change the meaning of responses that contain backslashes but are not actually escaped JSON blobs; consider gating this branch on a stricter pattern (eg starting with {\" or [{\") so we do not pretty-print mutated content.
Fix it with Roo Code or mention @roomote and request a fix.
ghost
approved these changes
Jan 30, 2026
ghost
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents UI hangups caused by large outputs being rendered as 1 line.
Improve MCP tool output readability in the chat UI by pretty-printing JSON responses when expanded while preserving raw output for copy.
Changes
Important
Enhance JSON response readability in
McpExecution.tsxby pretty-printing and preserving raw data for copying, with tests added for verification.McpExecution.tsxwhen expanded, including handling of escaped and double-encoded JSON.looksLikeJson,looksLikeEscapedJsonBlob,tryParseJsonValue, andtryUnescapeJsonBlobinMcpExecution.tsxto handle JSON parsing and formatting.McpExecution.spec.tsxto verify pretty-printing of minified, escaped, and double-encoded JSON, and handling of non-JSON responses.This description was created by
for ae18182. You can customize this summary. It will automatically update as commits are pushed.